package cn.com.sinux.spring.commons;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-9-6
 * Time: 上午9:57
 * To change this template use File | Settings | File Templates.
 */
public class ImageCropHelper {

    Integer x;
    Integer y;

    Integer width;
    Integer height;

    public Integer getX() {
        return x;
    }

    public void setX(Integer x) {
        this.x = x;
    }

    public Integer getY() {
        return y;
    }

    public void setY(Integer y) {
        this.y = y;
    }

    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public boolean isCrop() {
        if (width == null || height == null) {
            return false;
        }
        if (this.getX() == null) {
            this.x = 0;
        }
        if (this.getY() == null) {
            this.y = 0;
        }
        return true;
    }
}
